import request from '@/utils/request'

export const wechatMedias = params => {
  return request({
    url: '/wechat-medias',
    method: 'get',
    params
  })
}
export const delMessageRule = id => {
  return request({
    url: `/wechat-messages/${id}`,
    method: 'delete'
  })
}
export const updateWechatMessage = (data, id) => {
  return request({
    url: `/wechat-messages/${id}`,
    method: 'put',
    data
  })
}
export const messageInfo = id => {
  return request({
    url: `/wechat-messages/${id}`,
    method: 'get'
  })
}
export const addMessageRule = data => {
  return request({
    url: '/wechat-messages',
    method: 'post',
    data
  })
}
export const wechatMessages = params => {
  return request({
    url: '/wechat-messages',
    method: 'get',
    params
  })
}
export const groupInfo = id => {
  return request({
    url: `/wechat-groups/${id}`,
    method: 'get'
  })
}
export const updateWechatGroup = (data, id) => {
  return request({
    url: `/wechat-groups/${id}`,
    method: 'put',
    data
  })
}
export const addWechatGroup = data => {
  return request({
    url: '/wechat-groups',
    method: 'post',
    data
  })
}
export const wechatGroups = params => {
  return request({
    url: '/wechat-groups',
    method: 'get',
    params
  })
}
export const applyWechatMenu = data => {
  return request({
    url: '/wechat-menu-applications',
    method: 'post',
    data
  })
}
export const addSubButton = data => {
  return request({
    url: '/wechat-menus',
    method: 'post',
    data
  })
}
export const editButton = (data, id) => {
  return request({
    url: `/wechat-menus/${id}`,
    method: 'put',
    data
  })
}
export const delButton = id => {
  return request({
    url: `/wechat-menus/${id}`,
    method: 'delete'
  })
}
